/**
 * 保留x位小数
 */
export const decimalKeep = (num, x) => {
  let decimal = Math.pow(10, x)
  return Math.round(num * decimal) / decimal
}

/**
 * 格式化经纬度
 */
export const formartLonLat = (coors, x) => {
  let list = coors.map(item => {
    return decimalKeep(item, x)
  })
  return list
}